package com.mocha.bss.org.api;

import com.coffee.core.CoffeeResponse;
import com.mocha.bss.BssServerInfo;
import com.mocha.bss.org.api.fallback.AdmdivFeignFallbackFactory;
import com.mocha.bss.org.bo.PathBO;
import com.mocha.bss.org.vo.AdmdivVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author songkui
 * @since 2025/03/24
 */
@FeignClient(value = BssServerInfo.APPLICATION_NAME, contextId = "admdivFeignService", path = BssServerInfo.PATH_PREFIX+BssServerInfo.ADMDIV_PATH, fallbackFactory = AdmdivFeignFallbackFactory.class)
public interface AdmdivFeignService {

    @GetMapping("/list/{id}")
    CoffeeResponse<List<AdmdivVO>> listById(@PathVariable("id") Long id);

    @GetMapping("/list/parent/{parentId}")
    CoffeeResponse<List<AdmdivVO>> listByParentId(@PathVariable("parentId") Long id);

    @PostMapping("/list-in-path")
    CoffeeResponse<List<AdmdivVO>> listInPath(@RequestBody PathBO bo);

    @PostMapping("/filter")
    CoffeeResponse<List<AdmdivVO>> filter(@RequestBody PathBO bo);

    @PostMapping("/paths")
    CoffeeResponse<String[]> paths(@RequestBody PathBO bo);
}
